<?php 
global $_GPC, $_W;
$cfg = $this->module['config'];
$operation = !empty($_GPC['op']) ? $_GPC['op'] : 'display';
$shopid=$_GPC["shopid"];
if($operation=="display"){
    $list=pdo_fetchall("SELECT * FROM ".tablename('j_hmoney_ad')." WHERE weid='{$_W['uniacid']}' and groupid=0 and status=1  order by displayorder asc,id desc ");
    if($shopid)$list2=pdo_fetchall("SELECT * FROM ".tablename('j_hmoney_ad')." WHERE weid='{$_W['uniacid']}' and groupid=:a and status=1  order by displayorder asc,id desc ",array(":a"=>$shopid));
    if($list2){
        foreach($list2 as $row){
            $list[]=$row;
        }
    }
}
include $this->template('ad');